/*
 * Article.h
 *
 *  Created on: 2010-7-15
 *      Author: zhzuo
 */

#ifndef ARTICLE_H_
#define ARTICLE_H_

#include "Fun.h"

class Article{
public:
	struct Block{
		int guid;
		int type;
		QString content;
		QString path;
	};
	QString Label(DataRow&,bool);
	int guid;
	QString content;
	int createtime;
	QString title;
	bool Valid;
	Article(int i);
	Article();
	QVector<Block>* toSlice();
	bool Update();
	static bool Delete(int g);
	bool Delete(int g);
	int NextLabelID(int t);
	bool AddMultiMedia(int t,int lid,QString p);
	bool DelMultiMedia(int g);
private:
	void Init();
	DataTable* mmDt;
	//void Slice(QVector<Block>* vec,int startindex,DataRow& dr,QString str);
	DataRow* IsMultiMediaID(QString);
	void AppendBlock(QString,QVector<Article::Block>*);
	void AppendBlock(DataRow&,QVector<Article::Block>*);
};

#endif /* ARTICLE_H_ */
